﻿

Public Class Gestion



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim an As New Animales
        an.ShowDialog()

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim cl As New Clientes
        cl.ShowDialog()

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim ci As New Citas
        ci.ShowDialog()

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Dim pr As New Productos
        pr.ShowDialog()

    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Dim pv As New Proveedores
        pv.ShowDialog()

    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        Dim us As New Usuarios
        us.ShowDialog()
    End Sub

    Private Sub Gestion_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Dim res As Integer
        res = MsgBox("¿Está seguro de que desea cerrar esta sesión de usuario?", 20, "Aviso")
        If res <> 6 Then
            e.Cancel = True
        Else
            Login.Progbar.Value = 0
            Login.lblprog.Text = ""
            Login.usuariologin = ""
            Login.encargadologin = False
            Login.Show()
        End If

    End Sub



    Private Sub Gestion_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.CenterToScreen()
        If Login.encargadologin = False Then
            Button7.Hide()
        End If
    End Sub




    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        Dim inf As New Informes
        inf.ShowDialog()
    End Sub



    Private Sub CerrarSesiónToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CerrarSesiónToolStripMenuItem.Click
        Me.Close()
    End Sub

    Private Sub AnimalesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AnimalesToolStripMenuItem.Click
        Button1.PerformClick()
    End Sub

    Private Sub ClientesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClientesToolStripMenuItem.Click
        Button2.PerformClick()
    End Sub

    Private Sub ProveedoresToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProveedoresToolStripMenuItem.Click
        Button5.PerformClick()
    End Sub

    Private Sub ProductosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProductosToolStripMenuItem.Click
        Button4.PerformClick()
    End Sub

    Private Sub CitasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CitasToolStripMenuItem.Click
        Button3.PerformClick()
    End Sub

    Private Sub GenerarDocumentosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GenerarDocumentosToolStripMenuItem.Click
        Button6.PerformClick()
    End Sub

    Private Sub AyudaToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AyudaToolStripMenuItem1.Click
        Dim rutaEjecutable As String = System.IO.Directory.GetCurrentDirectory().ToString
        System.Diagnostics.Process.Start(rutaEjecutable & "\Ayuda.chm")
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        Dim ania As New AnimAdop
        ania.ShowDialog()
    End Sub

    Private Sub UsuariosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UsuariosToolStripMenuItem.Click
        Button8.PerformClick()
    End Sub
End Class